package com.bd.scm.module.userSyncData.controller;

import com.bd.scm.module.common.BaseController;
import com.bd.scm.module.userSyncData.service.UserSyncDataService;
import com.bd.utils.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**舍弗勒人员同步Controller
 * @author YH
 * @version 1.0
 * @date 2020/10/13 13:16
 */
@Slf4j
@RestController
@RequestMapping("/api/user")
public class UserSyncDataController extends BaseController {

    @Autowired
    private UserSyncDataService userSyncDataService;


    /**
     * 同步人员
     * @return
     */
    @GetMapping("datasync")
    public Result datasync(){
        try {
            String datasync = this.userSyncDataService.datasync();
            if(null == datasync){
                return Result.ok();
            }else{
                return Result.error(datasync);
            }
        } catch (Exception e) {
            e.printStackTrace();
            return Result.error(e.getMessage());
        }
    }
}
